#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

int main(int argc, char **argv)
{
    pid_t pid, ppid, pgid,sid;

    pid = getpid();
    ppid = getppid();
    pgid = getpgrp();
    sid = getsid(0);

    printf("pid:%d\n", pid);
    printf("ppid:%d\n", ppid);
    printf("pgid:%d\n", pgid);
    printf("sid:%d\n", sid);

    pgid = getpgid(0);
    printf("pgid:%d\n", pgid);

    while (1)
    {
        sleep(1);
    }

	return 0;
}
